package com.example.demo;

import com.example.demo.service.TestService1;
import com.example.demo.service1.BaseService;
import com.example.demo.service1.BaseService2;
import com.example.demo.service1.TestService2;
import com.example.demo.service1.impl.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@SpringBootApplication
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class DemoApplication implements CommandLineRunner {

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

	@Autowired
	TestService1 testService1;

	@Autowired
	BaseService baseService;

	@Autowired
	TestService3Impl testService3;

	@Autowired
	TestService4Impl testService4;

	@Autowired
	TestService5Impl testService5;

	@Autowired
	TestService6Impl testService6;

	@Autowired
	TestService7Impl testService7;

	@Override
	public void run(String... args) throws Exception {
		testService1.test();
//		new Thread(baseService).start();
		baseService.test();
		System.out.println("bbbbbbbbbbbbbbbb");
		baseService.run();
		testService3.test();
		new Thread(testService4).start(); //ok
		testService4.run();
		testService5.handle();
		testService5.test();
		testService6.handle();
		testService6.test();
		testService7.test();
		
		
		//添加
		testService4.test();
	}
}
